Skip to content

restore linux RID package#1823

Merged
shimat merged 4 commits intomainfrom
restore_linux_package
Feb 25, 2026
Merged

restore linux RID package#1823
shimat merged 4 commits intomainfrom
restore_linux_package

Conversation

@shimat
Copy link
Owner

@shimat shimat commented Feb 25, 2026

Fix #1820

Summary by CodeRabbit

  • New Features

    • Added linux-x64 portable runtime packages and a linux-x64.slim minimal variant for wider Linux distro support.
  • Documentation

    • Updated Linux Quick Start and installation guidance to recommend the portable linux-x64 RID and reflect slim options and updated build doc links.
  • Chores

    • CI updated to produce Linux x64 runtime packages on Ubuntu 22.04.

@shimat shimat self-assigned this Feb 25, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

Adds portable linux-x64 runtime NuGet packages (standard and slim), CI steps to pack them on Ubuntu 22.04, and documentation updates to recommend linux-x64 as the portable RID for Linux runtimes.

Changes

Cohort / File(s) Summary
Linux x64 Runtime Packages
nuget/OpenCvSharp4.official.runtime.linux-x64.csproj, nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj
New NuGet packaging projects (netstandard2.0/netstandard2.1/net8.0) that include libOpenCvSharpExtern.so under runtimes/linux-x64/native and package metadata; slim mirrors standard.
CI Workflow Updates
.github/workflows/ubuntu.yml, .github/workflows/ubuntu-slim.yml
Added steps gated to Ubuntu 22.04 that compute a date-based version (with optional -beta), run dotnet pack on the new csproj files, and emit NuGet artifacts.
Documentation
README.md
Replaced distro-specific Ubuntu references with generic Linux guidance, added linux-x64 and linux-x64.slim package entries, and updated embedded build doc links (docs/embedded-builds.md).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'restore linux RID package' directly addresses the main change of restoring linux RID (runtime identifier) packages to enable broader Linux compatibility per Microsoft RID catalog guidance.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #1820 to add libOpenCvSharpExtern.so under runtimes/linux-x64/native path alongside existing Ubuntu-specific RIDs.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #1820: adding linux-x64 NuGet packages, updating workflows, and documentation updates reflect the linux RID package restoration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch restore_linux_package

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
nuget/OpenCvSharp4.official.runtime.linux-x64.csproj (1)

25-25: Same backslash icon path as the slim variant

icon\opencvsharp.png — same concern as in linux-x64.slim.csproj. Prefer icon/opencvsharp.png for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nuget/OpenCvSharp4.official.runtime.linux-x64.csproj` at line 25, Update the
<None Include="icon\opencvsharp.png" Pack="true" PackagePath="" /> entry by
replacing the backslash in the Include attribute with a forward slash
(icon/opencvsharp.png) so the icon path matches the slim variant and uses
consistent, cross-platform path separators.
🧹 Nitpick comments (2)
README.md (1)

57-70: Document the glibc/libc baseline implicit in the linux-x64 package

The linux-x64 .so is built on Ubuntu 22.04, which links against glibc 2.35. This means the package will silently fail at runtime on systems with an older glibc (e.g., Alpine/musl, RHEL 7, Debian 10). A brief note in the installation section would save users from hard-to-diagnose runtime crashes.

Example addition to the section:

> **Note:** The `linux-x64` native binary is compiled on Ubuntu 22.04 (glibc 2.35).
> It will not work on musl-based distros (e.g., Alpine) or systems with glibc < 2.35.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 57 - 70, Add a short runtime compatibility note to
the "Linux (Ubuntu and other distributions)" installation text mentioning that
the OpenCvSharp4.official.runtime.linux-x64 native binary is compiled on Ubuntu
22.04 and links against glibc 2.35, so it will fail on musl-based distros (e.g.,
Alpine) or systems with glibc < 2.35; place the note near the package
installation steps and reference the package name
OpenCvSharp4.official.runtime.linux-x64 and the glibc version to warn users
about potential silent runtime failures.
.github/workflows/ubuntu-slim.yml (1)

186-196: Missing artifact listing after pack (minor inconsistency with ubuntu.yml)

The new step in ubuntu.yml ends with ls ${GITHUB_WORKSPACE}/artifacts for debugging, but this step omits it. No functional impact, but inconsistent.

🔧 Suggested fix
          cd ${GITHUB_WORKSPACE}/opencvsharp
          dotnet pack "nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o ${GITHUB_WORKSPACE}/artifacts -p:Version=$version
+
+          ls ${GITHUB_WORKSPACE}/artifacts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ubuntu-slim.yml around lines 186 - 196, Add a trailing
artifacts listing to match the other workflow step: after the dotnet pack
command that builds the slim runtime package (the line invoking dotnet pack
"nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o
${GITHUB_WORKSPACE}/artifacts -p:Version=$version), add a command to run ls
${GITHUB_WORKSPACE}/artifacts so the step prints the generated artifacts (keep
the surrounding env variables BETA, yyyymmdd, and version unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj`:
- Line 24: Update the MSBuild item Include path to use a forward slash so it
matches the actual filesystem and the surrounding entries: change the None
Include attribute value from using a backslash (icon\opencvsharp.png) to a
forward-slash path (icon/opencvsharp.png) in the <None Include="..."> element so
the icon path is consistent and cross-platform.

In `@README.md`:
- Around line 170-171: Update the README.md table entries for
OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim so the links won't 404 before first
publish: either replace the nuget.org anchors with placeholder text (e.g.,
"nuget link (pending publish)"), remove the hyperlink and keep package names as
plain text, or add a parenthetical note like "(NuGet package will 404 until
first publish)" next to the package names; ensure the change is applied to the
two symbols OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim in README.md.

---

Duplicate comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.csproj`:
- Line 25: Update the <None Include="icon\opencvsharp.png" Pack="true"
PackagePath="" /> entry by replacing the backslash in the Include attribute with
a forward slash (icon/opencvsharp.png) so the icon path matches the slim variant
and uses consistent, cross-platform path separators.

---

Nitpick comments:
In @.github/workflows/ubuntu-slim.yml:
- Around line 186-196: Add a trailing artifacts listing to match the other
workflow step: after the dotnet pack command that builds the slim runtime
package (the line invoking dotnet pack
"nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj" -o
${GITHUB_WORKSPACE}/artifacts -p:Version=$version), add a command to run ls
${GITHUB_WORKSPACE}/artifacts so the step prints the generated artifacts (keep
the surrounding env variables BETA, yyyymmdd, and version unchanged).

In `@README.md`:
- Around line 57-70: Add a short runtime compatibility note to the "Linux
(Ubuntu and other distributions)" installation text mentioning that the
OpenCvSharp4.official.runtime.linux-x64 native binary is compiled on Ubuntu
22.04 and links against glibc 2.35, so it will fail on musl-based distros (e.g.,
Alpine) or systems with glibc < 2.35; place the note near the package
installation steps and reference the package name
OpenCvSharp4.official.runtime.linux-x64 and the glibc version to warn users
about potential silent runtime failures.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4101911 and 763ef8d.

📒 Files selected for processing (6)
  • .github/workflows/ubuntu-slim.yml
  • .github/workflows/ubuntu.yml
  • README.md
  • docs/embedded-builds.md
  • nuget/OpenCvSharp4.official.runtime.linux-x64.csproj
  • nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj

Comment on lines +170 to +171
|**[OpenCvSharp4.official.runtime.linux-x64](https://www.nuget.org/packages/OpenCvSharp4.official.runtime.linux-x64/)**| Native bindings for Linux x64 (portable RID, recommended) |
|**[OpenCvSharp4.official.runtime.linux-x64.slim](https://www.nuget.org/packages/OpenCvSharp4.official.runtime.linux-x64.slim/)**| Slim native bindings for Linux x64 (portable RID), with `core,imgproc,imgcodecs,calib3d,features2d,flann,objdetect,photo` enabled |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

NuGet links will 404 until the first publish

The package links in the table point to packages that won't exist on nuget.org until this PR is merged and a publish workflow runs. Consider using placeholder text or a note until the packages are live, or ensure the publish workflow is part of this PR / triggered immediately after merge.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 170 - 171, Update the README.md table entries for
OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim so the links won't 404 before first
publish: either replace the nuget.org anchors with placeholder text (e.g.,
"nuget link (pending publish)"), remove the hyperlink and keep package names as
plain text, or add a parenthetical note like "(NuGet package will 404 until
first publish)" next to the package names; ensure the change is applied to the
two symbols OpenCvSharp4.official.runtime.linux-x64 and
OpenCvSharp4.official.runtime.linux-x64.slim in README.md.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj (2)

3-3: Trailing semicolon in TargetFrameworks.

The value netstandard2.0;netstandard2.1;net8.0; has a dangling semicolon after the last framework. MSBuild tolerates it, but it is non-idiomatic and inconsistent with SDK-style project conventions.

♻️ Proposed fix
-    <TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj` at line 3, Remove
the dangling semicolon from the TargetFrameworks element value so it lists
frameworks as "netstandard2.0;netstandard2.1;net8.0" (no trailing semicolon).
Edit the TargetFrameworks entry in the project file (the TargetFrameworks XML
element) to trim the trailing ';' to match SDK-style project conventions and
avoid the non-idiomatic dangling separator.

23-23: Add trailing slash to PackagePath to explicitly denote a directory path.

According to official Microsoft NuGet documentation, PackagePath must end with a folder separator (/ or \) to be treated as a directory. Without it, NuGet interprets PackagePath="runtimes/linux-x64/native" as a complete file path rather than a directory designation, which could place libOpenCvSharpExtern.so incorrectly.

This same pattern exists in the sibling non-slim project (OpenCvSharp4.official.runtime.linux-x64.csproj), so consider updating both files consistently:

♻️ Proposed fix
-    <None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native" />
+    <None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native/" />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj` at line 23, The
PackagePath attribute for the None item referencing libOpenCvSharpExtern.so is
missing a trailing folder separator so NuGet may treat it as a file path; update
the None element's PackagePath value from "runtimes/linux-x64/native" to
"runtimes/linux-x64/native/" (add the trailing slash) to explicitly mark a
directory, and apply the same change to the sibling
OpenCvSharp4.official.runtime.linux-x64.csproj to keep both projects consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj`:
- Line 3: Remove the dangling semicolon from the TargetFrameworks element value
so it lists frameworks as "netstandard2.0;netstandard2.1;net8.0" (no trailing
semicolon). Edit the TargetFrameworks entry in the project file (the
TargetFrameworks XML element) to trim the trailing ';' to match SDK-style
project conventions and avoid the non-idiomatic dangling separator.
- Line 23: The PackagePath attribute for the None item referencing
libOpenCvSharpExtern.so is missing a trailing folder separator so NuGet may
treat it as a file path; update the None element's PackagePath value from
"runtimes/linux-x64/native" to "runtimes/linux-x64/native/" (add the trailing
slash) to explicitly mark a directory, and apply the same change to the sibling
OpenCvSharp4.official.runtime.linux-x64.csproj to keep both projects consistent.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 763ef8d and 2bfddaf.

📒 Files selected for processing (2)
  • nuget/OpenCvSharp4.official.runtime.linux-x64.csproj
  • nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj
🚧 Files skipped from review as they are similar to previous changes (1)
  • nuget/OpenCvSharp4.official.runtime.linux-x64.csproj

@shimat shimat merged commit 0363b4a into main Feb 25, 2026
8 checks passed
@shimat shimat deleted the restore_linux_package branch February 25, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ubuntu: .NET SDK uses a smaller RID graph

1 participant